<?php 
function getValue($object,$name)
{
	if (isset($_POST[$name]))
		return $_POST[$name];
	else
		return $object->$name;
}

?>